package com.study.example.gameserver.module.buff.resource;

import com.sparrow.resource.annotation.Convert;
import com.sparrow.resource.annotation.ID;
import com.sparrow.resource.annotation.Resource;
import com.sparrow.resource.listener.AfterResourceLoad;
import com.study.example.gameserver.module.buff.domain.BuffEffectType;
import com.sparrow.common.buff.domain.IBuffEffectParam;

@Resource("config/BuffResource.xlsx")
public class BuffResource implements AfterResourceLoad {
    @ID
    private int id;
    private int maxStack;
    private boolean replace;
    private long duration;
    private BuffEffectType effectType;
    private String name;
    private String effectParam;
    private IBuffEffectParam effectParamInst;

    @Override
    public void afterLoad() {
        this.effectParamInst = effectType.parse(effectParam);
        this.effectParam = null;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getMaxStack() {
        return maxStack;
    }

    public void setMaxStack(int maxStack) {
        this.maxStack = maxStack;
    }

    public boolean isReplace() {
        return replace;
    }

    public void setReplace(boolean replace) {
        this.replace = replace;
    }

    public long getDuration() {
        return duration;
    }

    public void setDuration(long duration) {
        this.duration = duration;
    }

    public BuffEffectType getEffectType() {
        return effectType;
    }

    public void setEffectType(BuffEffectType effectType) {
        this.effectType = effectType;
    }

    public IBuffEffectParam getEffectParamInst() {
        return effectParamInst;
    }

    public void setEffectParamInst(IBuffEffectParam effectParamInst) {
        this.effectParamInst = effectParamInst;
    }

    public String getEffectParam() {
        return effectParam;
    }

    public void setEffectParam(String effectParam) {
        this.effectParam = effectParam;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
